<div ng-controller="ControllerLogin" data-ng-init="isWidget=true">
    <div class="loginOptions">
        <div data-ng-if="!isLogged">
            <a href="javascript:void(0)" data-toggle="modal" data-target="#formAddUser" class="button interactionAlt">Registrarse</a>
            <a href="javascript:void(0)" data-toggle="modal" data-target="#formLogin" class="button interaction">Ingresar</a>
        </div>
        <div data-ng-if="isLogged">
            <a href="/usuario/{{userId}}" class="button solid">{{userName}}</a>
            <a href="javascript:void(0)" data-ng-click="doLogout()" class="button solid"><span class="fa fa-sign-out"></span>
                Salir</a>
        </div>
    </div>
    <div id="formLogin" class="modal fade" role="dialog" aria-hidden="true" data-ng-if="!isLogged">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    Ingresar
                </div>
                <div class="modal-body clearfix">
                    <span class="alert error" data-ng-if="showMessage">{{message}}</span>
                    <form name="login" method="post" data-ng-submit="doLogin()">
                        <label>Usuario</label>
                        <input type="text" name="userName" data-ng-model="user.username" required/>
                        <label>Contraseña</label>
                        <input type="password" name="userPassword" data-ng-model="user.secretword" required/>
                        <input type="submit" value="Entrar" class="right"/>
                        <input type="button" value="Cancelar" class="right" data-toggle="modal"
                               data-target="#formLogin"/>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div id="formAddUser" data-ng-controller="ControllerUsers" class="modal fade" data-ng-init="isWidget=true; role='voluntario'" data-ng-if="!isLogged">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    Registrarse
                </div>
                <div class="modal-body clearfix">
                    <span class="alert error" data-ng-if="showMessage">{{message}}</span>
                    <form id="quickAddUser" name="addUserForm" method="post" data-ng-submit="addUser()"
                          class="clearfix">
                        <label for="quName">Nombre</label>
                        <input id="quName" type="text" name="userName" data-ng-model="user.name" required/>
                        <label for="quLastName">Apellidos</label>
                        <input id="quLastName" type="text" name="userLastName" data-ng-model="user.lastname" required/>
                        <label for="quUsername">Nombre de usuario</label>
                        <input id="quUsername" type="text" name="userName" data-ng-model="user.username" required/>
                        <label for="quSecretword">Contraseña</label>
                        <input id="quSecretword" type="password" name="userPassword" data-ng-model="user.secretword"
                               required/>
                        <input type="submit" value="Registrar" class="right"/>
                        <input type="button" value="Cancelar" class="right" data-toggle="modal"
                               data-target="#formAddUser"/>
                    </form>
                    {{messageSign}}
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $('#formLogin').modal({show: false});
    $('#formAddUser').modal({show: false});
</script>